//
//  BuyItemTableViewCell.m
//  JiuJiuShangCheng
//
//  Created by jiujiukeji on 2018/7/13.
//  Copyright © 2018年 jiujiukeji. All rights reserved.
//

#import "BuyItemTableViewCell.h"

@implementation BuyItemTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setUpUI];
    }
    return self;
}
- (void)setUpUI
{
    WeakSelf
    self.leftLB = [UILabel labelWithText:@"" textColor:UIColorFromRGB(0x323232) fontSize:13];
    [_leftLB sizeToFit];
    [self addSubview:_leftLB];
    [_leftLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(rateWidth(30));
        make.centerY.equalTo(self);
    }];
    
    self.arrow = [[UIImageView alloc] init];
    _arrow.image = UIImageNamed(@"rightArrow");
    [_arrow sizeToFit];
    [self addSubview:_arrow];
    [_arrow mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.right.equalTo(self).offset(-rateWidth(25));
    }];
    
    self.rightLB = [UILabel labelWithText:@"" textColor:UIColorFromRGB(0x323232) fontSize:13];
    [_rightLB sizeToFit];
    [self addSubview:_rightLB];
    [_rightLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.right.equalTo(weakSelf.arrow.mas_left).offset(-rateWidth(20));
    }];
    
    self.redLB = [UILabel labelWithText:@"" textColor:UIColorFromRGB(0xf55555) fontSize:13];
    [_redLB sizeToFit];
    [self addSubview:_redLB];
    [_redLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.right.equalTo(self).offset(-rateWidth(30));
    }];
    _redLB.hidden = YES;
    
    UIView *line = [[UIView alloc] init];
    line.backgroundColor = globalGray;
    [self addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self);
        make.height.equalTo(@(rateHeight(2)));
    }];
}

@end
